package com.pillar.handler;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.pillar.request.BasePackage;
import io.netty.channel.Channel;

/**
 * @author pillar
 * @desc
 * @email: 347637454@qq.com
 * @createDate 2021-01-04 15:11
 */
public interface IHandler {
    /**
     * 是否处理
     * @param basePackage
     * @return
     */
    boolean apply(BasePackage basePackage);

    /**
     * 处理消息
     * @param channel
     * @param basePackage
     * @return
     */
    boolean consume(Channel channel, BasePackage basePackage) throws JsonProcessingException;
}
